<?php
namespace app\index\model;
use think\Model;

/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/3/22
 * Time: 16:04
 */
class Account extends Model{
	protected $table = 'boc_account';
    protected $connection = 'JXC';
    public function getintegral($where){
        $data=Account::where($where)->value('integral');
        return $data;
    }
    public function getone($where){
        $data=Account::where($where)->find();
        return $data;
    }
    public function getcount($where){
        $data=Account::where($where)->count();
        return $data;
    }
    public function getlist($where,$limit,$start=0,$order=false,$fields="*"){
//        $validate=new \app\index\validate\Manager();
//        if(!$validate->check($param)){
//            return $this->returnMsg('1002','');
//        }
        if (!$order) {
            $order=array('id' => 'desc');
        }
        $data=Account::where($where)->limit($start,$limit)->order($order)->select();
        return $data;
    }
    public function add($data){
        $data=Account::insertGetId($data);
        return $data;
    }
    public function deluser($where){
        $data=Account::where($where)->delete();
        return $data;
    }
    public function updateacct($updates,$where){
        $data=Account::save($updates,$where);
        return $data;
    }
}